<%--
  Created by IntelliJ IDEA.
  User: wwh
  Date: 2017/9/8
  Time: 20:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="admin-main">
    <div id="college">
        <fieldset class="layui-elem-field">
            <legend>选择简历</legend>
            <div class="layui-field-box">
                <form class="layui-form">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">简历：</label>
                            <div class="layui-input-inline" style="width: 400px">
                                <select name="CVid" lay-verify="chooseCV" id="showCV"
                                        lay-search>
                                    <option value="">请选择简历</option>
                                </select>
                            </div>
                            <button class="layui-btn" lay-filter="selectCV" lay-submit>应聘</button>
                        </div>
                    </div>
                </form>
            </div>
        </fieldset>
    </div>
</div>
<script>
    "use strict";
    console.log(userid);
    layui.use(['form','layer','jquery'],function () {
         var form = layui.form(),
             $ = layui.jquery;

         axios.post('/cv/findByCondition',{stid:userid})
             .then(function (response) {
                 console.log(response);
                 var array = response.data.data;
                 var html = '';
                 for(var i in array){
                     html += '<option value='+ array[i].id +'>' + array[i].filename.split("/")[array[i].filename.split("/").length-1] + '</option>';
                 }
                 $('#showCV').append(html);
                 form.render('select');
             })
             .catch(function (msg) {
                 console.log(msg);
             })
    });
</script>
